<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                        <a href="javascript:;" class="btn btn-default" style="font-size:14px;color:dodgerblue;" id="getcount" >
                            <i class="fa fa-dollar"></i>
                            <span class="extend" >
                                订货数量：<span id="num">0</span>
                                订货金额：<span id="price">0</span>
                                合计金额：<span id="sfhj">0</span>
                            </span>
                        </a>
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>
<script id="customformtpl" type="text/html">
    <!--form表单必须添加form-commsearch这个类-->
    <form action="" class="form-commonsearch">
        <div style="border-radius:2px;margin-bottom:10px;background:#f5f5f5;padding:15px 20px;">
            <div class="row">
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="form-group">
                        <label class="control-label">客户</label>
                        <!--隐式的operate操作符，必须携带一个class为operate隐藏的文本框,且它的data-name="字段",值为操作符-->
                        <input class="operate" type="hidden" data-name="customer_id" value="like"/>
                        <div>
                            <input id="c-customer" data-rule="required" data-source="customer/customer/index" data-field="company" class="form-control selectpage" name="customer_id" type="text" value="{$customer_id}" data-multiple="true">
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="form-group">
                        <label class="control-label">商品编号</label>
                        <input type="hidden" class="operate" data-name="number" value="like"/>
                        <div>
                            <input id="c-number"  class="form-control " name="number" type="text"
                                   value="{$number}" style="display:block;">
                            <a class="screen">筛选</a>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="form-group">
                        <label class="control-label">出库仓库</label>
                        <input type="hidden" class="operate" data-name="storehouse_id" value="="/>
                        <div>
                            <input id="c-storehouse_id" data-rule="required" data-source="data/storehouse/index" data-field="name" class="form-control selectpage" name="storehouse_id" type="text" value="{$storehouse_id}" >
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="form-group">
                        <label class="control-label">开始时间</label>
                        <input type="hidden" class="operate" data-name="start_time" value="="/>
                        <div>
                            <input id="c-start_time" class="form-control datetimepicker start_time" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="start_time" type="text" value="{$start_time}">
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="form-group">
                        <label class="control-label">结束时间</label>
                        <input type="hidden" class="operate" data-name="end_time" value="="/>
                        <div>
                            <input id="c-end_time" class="form-control datetimepicker end_time" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="end_time" type="text" value="{$end_time}">
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="form-group">
                        <label class="control-label"></label>
                        <input type="hidden" class="operate" data-name="storehouse_id" value="="/>
                        <div class="row">
                            <div class="col-xs-6">
                                <input type="submit" class="btn btn-success btn-block" value="搜索"/>
                            </div>
                            <!--                            <div class="col-xs-6">-->
                            <!--                                <input type="reset" class="btn btn-primary btn-block" value="重置"/>-->
                            <!--                            </div>-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<script>
    function getrequisition(sid){
        var num = $('#c-number').val()
        if(num == ''){
            $('#c-number').val(sid)
        }else{
            num = num+','+sid
            $('#c-number').val(num)
        }

    }
</script>